How Clean and Simple Code Can Be

BTI360 Blog / July 21, 2014 in 

Our journey of reviewing different implementations of the Look-and-Say sequence concludes today with a simple and clean submission. Dan and Ashley pair programmed to bring us this solution to remind us how clean and simple code can be.

First, you’ll notice how tight this solution is. Short, sweet, and to the point.

Second, it uses regular expressions to parse the Look-and-Say pattern. The simplicity of this solution is a reminder of the power of RegEx.

Lastly, unlike Chris’ implementation that included both RegEx and recursion, Dan and Ashley have used a while loop to iterate through the matches.

It’s simple, clean, and easy to follow.

Great work Dan and Ashley!

Previous

The Look-and-Say Sequence Through the Eyes of a Scala Enthusiast

Next

4 Tips on How to Ship Software Fast Like Facebook

Close Form

Enjoy our Blog?

Then stay up-to-date with our latest posts delivered right to your inbox.

  • This field is for validation purposes and should be left unchanged.

Or catch us on social media

Stay in Touch

Whether we’re honing our craft, hanging out with our team, or volunteering in the community, we invite you to keep tabs on us.

  • This field is for validation purposes and should be left unchanged.